home *** CD-ROM | disk | FTP | other *** search
/ Object Oriented Applicat…isualAge for C++ for OS/2 / Object-Oriented Application Development with VisualAGE for C++ for OS2.iso / visual / vrsc.cmd < prev    next >
OS/2 REXX Batch file  |  1996-02-28  |  11KB  |  377 lines

  1. /*REXX  vrsc 1 d: e:\real */
  2.  
  3.  
  4. /*   PMSCRIPT.CMD   Project Smarts install script for PM project
  5.  *
  6.  *   Licensed Materials - Property of IBM
  7.  *
  8.  *   "Restricted Materials of IBM"
  9.  *
  10.  *   IBM WorkFrame
  11.  *
  12.  *   (C) Copyright IBM Corp. 1995. All Rights Reserved.
  13.  *
  14.  *   US Government Users Restricted Rights - Use, duplication or
  15.  *   disclosure restricted by GSA ADP Schedule Contract with
  16.  *   IBM Corp.
  17.  *
  18.  */
  19.  
  20. /* trace all */
  21. PARSE ARG component drive base
  22.  
  23. buyer    = base'\BUYER'
  24. common   = base'\COMMON'
  25. dacs     = base'\DACSLIB'
  26. help     = base'\HELP'
  27. property = base'\PROPERTY'
  28. sale     = base'\SALE'
  29. service  = base'\SERVICE'
  30.  
  31.  
  32. say component
  33. say drive
  34. say base
  35. say buyer
  36. say common
  37. say dacs
  38. say help
  39. say property
  40. say sale
  41. say service
  42.  
  43.  
  44. /* Load the REXX utility functions. */
  45. rc = RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs');
  46. rc = SysLoadFuncs();
  47.  
  48. /* Load the Tools Setup utility functions */
  49. rc = RxFuncAdd('IwfEnvPrfLoadFuncs', 'IWFPAPI', 'IwfRxEnvPrfLoadFuncs');
  50. rc = IwfEnvPrfLoadFuncs();
  51.  
  52. rc = RxFuncAdd('iwfLoadFuncs', 'IWFREXX', 'iwfLoadFuncs');
  53. rc = iwfLoadFuncs();
  54.  
  55.  
  56. /* Initialize - use a global stem variable. */
  57. stem = "stem"
  58. cppdir = value('CPPMAIN',,'OS2ENVIRONMENT');
  59. If cppdir=""
  60.   Then
  61.      signal Abort
  62.   Else
  63.      defprj=cppdir"\MAINPRJ\VACPP"
  64.  
  65. /* Look for the Desktop in use */
  66. /* look for desktop in HPFS drive */
  67. rc = SysFileTree(drive':\Visual Realty',dirspec,'SD');
  68.  
  69. say 'found 1:' dirspec.0
  70.  
  71. /* if not found, maybe it's a FAT drive */
  72. if( dirspec.0 = 0 ) then
  73.   rc = SysFileTree(drive':\VISUAL_R',dirspec,'SD');
  74.  
  75. say 'found 2:' dirspec.0
  76.  
  77. loc = 0;
  78. deskdir = ""
  79. Do cnt=1 to dirspec.0 while loc = 0
  80.   parse var dirspec.cnt with a b c deskdir
  81.   deskdir = STRIP(deskdir, 'L')
  82.   loc = pos(drive':\Desktop', deskdir)
  83. End                                                               /* End do*/
  84.  
  85. say deskdir
  86.  
  87.  
  88. If component=3
  89.   Then
  90.   Do
  91.     rc = SysDestroyObject(base'\vbload.dat');
  92.     rc = SysDestroyObject(base'\property\vbload.dat');
  93.     rc = SysDestroyObject(base'\buyer\vbload.dat');
  94.     rc = SysDestroyObject(base'\service\vbload.dat');
  95.     rc = SysDestroyObject(base'\sale\vbload.dat');
  96.     rc = SysDestroyObject(base'\common\vbload.dat');
  97.     rc = SysFileTree(deskdir'\VRFULL',vrpr,'SF');
  98.     If (vrpr.0 <> 0)
  99.       Then
  100.          rc = SysDestroyObject(deskdir'\VRFULL');
  101.     rc = SysFileTree(deskdir'\VRBOOK',vrpr,'SF');
  102.     If (vrpr.0 = 0)
  103.       Then
  104.          rc = SysDestroyObject(deskdir'\DACSPRJ');
  105.     signal Close
  106.   End
  107.  
  108. If component=4
  109.   Then
  110.   Do
  111.     rc = SysDestroyObject(base'\vbload.dat');
  112.     rc = SysDestroyObject(base'\property\vbload.dat');
  113.     rc = SysDestroyObject(base'\service\vbload.dat');
  114.     rc = SysDestroyObject(base'\common\vbload.dat');
  115.     rc = SysFileTree(deskdir'\VRBOOK',vrpr,'SF');
  116.     If (vrpr.0 <> 0)
  117.       Then
  118.          rc = SysDestroyObject(deskdir'\VRBOOK');
  119.     rc = SysFileTree(deskdir'\VRFULL',vrpr,'SF');
  120.     If (vrpr.0 = 0)
  121.       Then
  122.          rc = SysDestroyObject(deskdir'\DACSPRJ');
  123.     signal Close
  124.   End
  125.  
  126.  
  127. /* Create Main project */
  128. If component=1
  129.   Then
  130.       stem.pszSourceProject   = base'\VRFULL'
  131.   Else
  132.       stem.pszSourceProject   = base'\VRBOOK'
  133.  
  134. /*
  135. say base
  136. say deskdir
  137. say stem.pszSourceProject
  138. */
  139. stem.pszTargetProject   = ''
  140. stem.pszTargetProjectSetup = 'PAMLOCATION:IWFBPAM='base';PAMDEFAULT:IWFBPAM='base';TARGETNAME=vrmain.exe;MAKEFILENAME=vrmain.mak;INHERITLIST='defprj';'
  141. stem.pszTargetDirectory = ''
  142. stem.pszTargetFolder    = deskdir
  143. rc = iwfCreateProjectFromProject(stem);
  144.  
  145. /* Create DACS project */
  146. rc = SysFileTree(deskdir'\DACSPRJ',daxprj,'SF');
  147. If (daxprj.0 = 0)
  148.   Then
  149.   Do
  150.        stem.pszSourceProject   = base'\DACSPRJ'
  151.        stem.pszTargetProject   = ''
  152.        stem.pszTargetProject   = ''
  153.        stem.pszTargetProjectSetup = 'TARGETNAME=vrdacs.dll;MAKEFILENAME=vrdacs.mak;'
  154.        stem.pszTargetDirectory = ''
  155.        stem.pszTargetFolder    = deskdir
  156.        rc = iwfCreateProjectFromProject(stem);
  157.   End
  158.  
  159. /* Modify Help project */
  160. rc = SysSetObjectData(base"\Help1","PAMLOCATION:IWFBPAM="help);
  161. rc = SysSetObjectData(base"\Help1","PAMDEFAULT:IWFBPAM="help);
  162. rc = SysSetObjectData(base"\Help1","INHERITLIST="defprj);
  163.  
  164. /* Modify Property project */
  165. rc = SysSetObjectData(base"\Propert","PAMLOCATION:IWFBPAM="property);
  166. rc = SysSetObjectData(base"\Propert","PAMDEFAULT:IWFBPAM="property);
  167. rc = SysSetObjectData(base"\Propert","INHERITLIST="defprj);
  168.  
  169. /* Modify Buyer project */
  170. If component = 1
  171.   Then
  172.   Do
  173.      rc = SysSetObjectData(property"\Buyer","PAMLOCATION:IWFBPAM="buyer);
  174.      rc = SysSetObjectData(property"\Buyer","PAMDEFAULT:IWFBPAM="buyer);
  175.      rc = SysSetObjectData(property"\Buyer","INHERITLIST="defprj);
  176.   End
  177.  
  178. /* Modify Sale project */
  179. If component = 1
  180.   Then
  181.   Do
  182.      rc = SysSetObjectData(buyer"\Sale","PAMLOCATION:IWFBPAM="sale);
  183.      rc = SysSetObjectData(buyer"\Sale","PAMDEFAULT:IWFBPAM="sale);
  184.      rc = SysSetObjectData(buyer"\Sale","INHERITLIST="defprj);
  185.   End
  186.  
  187. /* Modify Service project */
  188. rc = SysSetObjectData(sale"\Service","PAMLOCATION:IWFBPAM="service);
  189. rc = SysSetObjectData(sale"\Service","PAMDEFAULT:IWFBPAM="service);
  190. rc = SysSetObjectData(sale"\Service","INHERITLIST="defprj);
  191.  
  192. /* Modify Common project */
  193. rc = SysSetObjectData(service"\Common","PAMLOCATION:IWFBPAM="common);
  194. rc = SysSetObjectData(service"\Common","PAMDEFAULT:IWFBPAM="common);
  195. rc = SysSetObjectData(service"\Common","INHERITLIST="defprj);
  196.  
  197. /* Modify Dacslib project */
  198. rc = SysSetObjectData(service"\Dacslib","PAMLOCATION:IWFBPAM="dacs);
  199. rc = SysSetObjectData(service"\Dacslib","PAMDEFAULT:IWFBPAM="dacs);
  200. rc = SysSetObjectData(service"\Dacslib","INHERITLIST="deskdir"\DACSPRJ");
  201.  
  202.  
  203. /* Set up variable for the main project */
  204.  
  205. If component=1
  206.   Then
  207.      stem.pszProject = deskdir'\VRFULL'
  208.   Else
  209.      stem.pszProject = deskdir'\VRBOOK'
  210. stem.pszName = 'HELP'
  211. stem.pszValue = help';%HELP%'
  212. rc = IwfAddVariable(stem);
  213.  
  214. stem.pszName= 'LIB'
  215. If component=1
  216.   Then
  217.      stem.pszValue = buyer';'common';'dacs';'property';'sale';'service';%LIB%'
  218.   Else
  219.      stem.pszValue = common';'dacs';'property';'service';%LIB%'
  220. rc = IwfAddVariable(stem);
  221.  
  222. stem.pszName = 'INCLUDE'
  223. If component=1
  224.   Then
  225.      stem.pszValue = buyer';'common';'dacs';'property';'sale';'service';%INCLUDE%'
  226.   Else
  227.      stem.pszValue = common';'dacs';'property';'service';%INCLUDE%'
  228. rc = IwfAddVariable(stem);
  229.  
  230.  
  231. /* Set up variable for the property project */
  232.  
  233. stem.pszProject = base'\Propert'
  234.  
  235. stem.pszName= 'LIB'
  236. If component=1
  237.   Then
  238.      stem.pszValue = buyer';'common';'dacs';'sale';'service';%LIB%'
  239.   Else
  240.      stem.pszValue = common';'dacs';'service';%LIB%'
  241. rc = IwfAddVariable(stem);
  242.  
  243. stem.pszName = 'INCLUDE'
  244. If component=1
  245.   Then
  246.      stem.pszValue = buyer';'common';'dacs';'sale';'service';%INCLUDE%'
  247.   Else
  248.      stem.pszValue = common';'dacs';'service';%INCLUDE%'
  249. rc = IwfAddVariable(stem);
  250.  
  251.  
  252.  
  253. /* Set up variable for the Buyer project */
  254. If component=1
  255.   Then
  256.   Do
  257.      stem.pszProject = property'\Buyer'
  258.  
  259.      stem.pszName= 'LIB'
  260.      stem.pszValue = common';'dacs';'service';%LIB%'
  261.      rc = IwfAddVariable(stem);
  262.  
  263.      stem.pszName = 'INCLUDE'
  264.      stem.pszValue = common';'dacs';'service';%INCLUDE%'
  265.      rc = IwfAddVariable(stem);
  266.   End
  267.  
  268.  
  269. /* Set up variable for the Sale project */
  270. If component=1
  271.   Then
  272.   Do
  273.      stem.pszProject = buyer'\Sale'
  274.  
  275.      stem.pszName= 'LIB'
  276.      stem.pszValue = common';'dacs';'service';%LIB%'
  277.      rc = IwfAddVariable(stem);
  278.  
  279.      stem.pszName = 'INCLUDE'
  280.      stem.pszValue = common';'dacs';'service';%INCLUDE%'
  281.      rc = IwfAddVariable(stem);
  282.   End
  283.  
  284. /* Set up variable for the Service project */
  285.  
  286. stem.pszProject = sale'\Service'
  287.  
  288. stem.pszName= 'LIB'
  289. stem.pszValue = common';'dacs';%LIB%'
  290. rc = IwfAddVariable(stem);
  291.  
  292. stem.pszName = 'INCLUDE'
  293. stem.pszValue = common';'dacs';%INCLUDE%'
  294. rc = IwfAddVariable(stem);
  295.  
  296.  
  297. /* Building vbload.dat for Main project */
  298. filename=base'\vbload.dat'
  299. rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
  300. rc = lineout(filename,cppdir'\DDE4VB\VBMM.VBB');
  301. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  302. If component=1
  303.   Then
  304.   Do
  305.      rc = lineout(filename,base'\BUYER\VRBUY.VBB');
  306.      rc = lineout(filename,base'\SALE\VRSALE.VBB');
  307.   End
  308. rc = lineout(filename,base'\PROPERTY\VRPROP.VBB');
  309. rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
  310. rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
  311. rc = lineout(filename);
  312.  
  313. /* Building vbload.dat for Property project */
  314. filename=base'\property\vbload.dat'
  315. rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
  316. rc = lineout(filename,cppdir'\DDE4VB\VBMM.VBB');
  317. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  318. If component=1
  319.   Then
  320.   Do
  321.      rc = lineout(filename,base'\BUYER\VRBUY.VBB');
  322.      rc = lineout(filename,base'\SALE\VRSALE.VBB');
  323.   End
  324. rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
  325. rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
  326. rc = lineout(filename);
  327.  
  328. /* Building vbload.dat for Buyer project */
  329. filename=base'\buyer\vbload.dat'
  330. rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
  331. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  332. rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
  333. rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
  334. rc = lineout(filename);
  335.  
  336. /* Building vbload.dat for Sale project */
  337. filename=base'\sale\vbload.dat'
  338. rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
  339. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  340. If component=1
  341.   Then
  342.      rc = lineout(filename,base'\BUYER\VRBUY.VBB');
  343. rc = lineout(filename,base'\PROPERTY\VRPROP.VBB');
  344. rc = lineout(filename,base'\COMMON\VRCOMM.VBB');
  345. rc = lineout(filename,base'\SERVICE\VRSERV.VBB');
  346. rc = lineout(filename);
  347.  
  348. /* Building vbload.dat for Service project */
  349. filename=base'\service\vbload.dat'
  350. rc = lineout(filename,cppdir'\DDE4VB\VBDAX.VBB');
  351. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  352. rc = lineout(filename);
  353.  
  354. /* Building vbload.dat for Common project */
  355. filename=base'\common\vbload.dat'
  356. rc = lineout(filename,cppdir'\DDE4VB\VBSAMPLE.VBB');
  357. rc = lineout(filename);
  358.  
  359.  
  360. /* We are done. */
  361. /* Close the installation console. */
  362. /* Unload the environment profile functions */
  363. Close:
  364. rc = IwfEnvPrfDropFuncs();
  365. rc = IwfDropFuncs();
  366. exit(0);
  367.  
  368. /* VisualAge C++ not installed: Error!!!! */
  369. Abort:
  370. rc = IwfEnvPrfDropFuncs();
  371. rc = IwfDropFuncs();
  372. rc=RxMessageBox("VisualAge C++ is not properly installed on your system. The installation program cannot setup the Visual Realty projects. You must FIRST install VisualAge C++, then re-install the Visual Realty application.",,,);
  373. exit(8)
  374.  
  375.  
  376.  
  377.